<template>
	<j-cell-group>
		<j-cell-card title="工作模式" :tips="CameraWhiteLight.WorkMode" :show="false" :is-touch="false" border style="background: #f5f7fb">
			<j-cell title="自动" tips="Auto" :more="false"></j-cell>
			<j-cell title="定时" tips="Timming" :more="false"></j-cell>
			<j-cell title="一直开启" tips="KeepOpen" :more="false"></j-cell>
			<j-cell title="智能模式（双光灯专有）" tips="Intelligent" :more="false"></j-cell>
			<j-cell title="气氛灯 (音乐灯专有)" tips="Atmosphere" :more="false"></j-cell>
			<j-cell title="随音乐闪动 (音乐灯专有)" tips="Glint" :more="false"></j-cell>
			<j-cell title="关闭" tips="Close" :more="false"></j-cell>
		</j-cell-card>
		<j-cell title="亮度" :tips="CameraWhiteLight.Brightness" :more="false"></j-cell>
		<j-cell-card title="物体移动自动亮灯配置" tips="在Intelligent模式下有效" :show="false" :is-touch="false" border style="background: #f5f7fb">
			<j-cell title="移动检测灵敏度" :tips="CameraWhiteLight.MoveTrigLight.Level" :more="false"></j-cell>
			<j-cell title="报警结束后亮灯持续时间" :tips="CameraWhiteLight.MoveTrigLight.Duration" :more="false"></j-cell>
		</j-cell-card>
		<j-cell-card title="工作时间段" tips="在Timming模式下有效" :show="false" :is-touch="false" border style="background: #f5f7fb">
			<j-cell title="开始小时" :tips="CameraWhiteLight.WorkPeriod.SHour" :more="false"></j-cell>
			<j-cell title="开始分钟" :tips="CameraWhiteLight.WorkPeriod.SMinute" :more="false"></j-cell>
			<j-cell title="结束小时" :tips="CameraWhiteLight.WorkPeriod.EHour" :more="false"></j-cell>
			<j-cell title="结束分钟" :tips="CameraWhiteLight.WorkPeriod.EMinute" :more="false"></j-cell>
		</j-cell-card>
	</j-cell-group>
</template>

<script>
export default {
    data() {
        return {
            token: '',
            CameraWhiteLight: {
                WorkMode: '',
                Brightness: '',

                MoveTrigLight: {
                    Level: '',
                    Duration: ''
                },

                WorkPeriod: {
                    SHour: '',
                    SMinute: '',
                    EHour: '',
                    EMinute: ''
                }
            }
        };
    }
    /**
     * 生命周期函数--监听页面加载
     */,
    onLoad: function (options) {
        console.log(options);
		this.token =  options.token
		this.getconfig();
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {},
    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {},
    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {},
    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {},
    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {},
    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {},
    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {},
    methods: {
        getconfig() {
            uni.showLoading();
            let token = this.token;
            let data = {
                Name: 'Camera.WhiteLight'
            };
            getApp().globalData.api.getconfig(data, token, (result) => {
                uni.hideLoading({
                    success: (res) => {
                        console.log(result);
                        this.CameraWhiteLight = result['Camera.WhiteLight']
                    }
                });
            });
        }
    }
};
</script>
<style></style>
